// MFCRichEdit.cpp : implementation file
//

#include "stdafx.h"
#include "VisualStudioATLApp.h"
#include "VisualStudioATLView.h"

// CVisualStudioATLView

CVisualStudioATLView::CVisualStudioATLView()
{

}

CVisualStudioATLView::~CVisualStudioATLView()
{
}


BOOL CVisualStudioATLView::PreTranslateMessage(MSG* pMsg)
{
	pMsg;
	return FALSE;
}
HRESULT STDMETHODCALLTYPE CVisualStudioATLView::CreateWnd(saf::IGenericPanel *pParent, HWND hWndParent)
{
	CRect _Rect(0,0, 100, 100);

	//WS_HSCROLL|WS_VSCROLL|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|ES_LEFT,
	if (Create(hWndParent, rcDefault, NULL,
		WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE))
	{
		return S_OK;
	}

	return S_FALSE;
}

HRESULT STDMETHODCALLTYPE CVisualStudioATLView::OnCloseDataView(saf::safCloseAction *ca)
{
	*ca = saf::safCloseActionFree;

	return S_OK;
}


STDMETHODIMP CVisualStudioATLView::OnMdiActiveDataView(saf::IMdiContainer *pMdiContainer,
							   saf::IGenericPanel *pParentGenericPanel,
							   saf::ITabPageItem *pTabPageItem,
							   UINT nType,
							   VARIANT_BOOL *bActive)
{
	*bActive = VARIANT_TRUE;
	return S_OK;
}


STDMETHODIMP CVisualStudioATLView::OnGenericPanelActiveDataView(saf::IGenericPanel *pParentGenericPanel,
										saf::IGenericPanelItem *pGenericPanelItem,
										UINT nType,
										VARIANT_BOOL *bActive)
{
	*bActive = VARIANT_TRUE;
	return S_OK;
}


LRESULT CVisualStudioATLView::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CPaintDC dc(m_hWnd);

	//TODO: Add your drawing code here

	return 1;
}

